from ogreEx.blender.types import Menu
from ogreEx.ui.UIClass import OTHER
from ogreEx.ui.operator.CINFO_MT_instance import INFO_MT_instance

## Selector extras
@OTHER
class INFO_MT_instances(Menu):
    bl_label = "Instances"
    
    def draw(self, context):
        layout = self.layout
        inst = gather_instances()
        for data in inst:
            ob = inst[data][0]
            op = layout.operator(INFO_MT_instance.bl_idname, text=ob.name)    # operator has no variable for button name?
            op.mystring = ob.name
        layout.separator()